Fix addRule for functional values, fix #475#477
Conversation
|
Why do you call toString() before .update()? |
|
We call .toString in injectRule, that called in addRule. and we make .addRule before .update |
|
Maybe we should change the behavior there? |
|
I am not sure what will happen if we render a rule without props in different browsers. |
|
But we can add rule without data (for lazy apply for example), and it's a normal behavior for user |
|
Yeah, need to run tests in all browsers. |
|
if we will have some issues with browsers, we always can render an empty prop |
|
what is an "empty" prop? |
just an empty string, for example |
|
color: '' is an invalid value, I don't know what this might cause. |
|
"initial" is an actual value which might lead to unexpected results from the user perspective |
|
|
| }) | ||
| }) | ||
|
|
||
| /* |
There was a problem hiding this comment.
sorry, just forgot to uncomment
| } | ||
|
|
||
| if (!result) return result | ||
| if (!(result || hasFunctionValue)) return result |
There was a problem hiding this comment.
much more readable:
if (!result && !hasFunctionValue) return result4ebaee9 to
b9e3da2
Compare
|
some browsers time out on browserstack, trying to figure out why. |
The problem is that
rule.toString()returns nothing if we have just function values in rule without calculated values. So it needs to return just an empty rule like.class {}to be applied to the stylesheet.